//完成异步读取
const fs=require('fs');
//一。定义承诺，Promise
let p=new Promise((resolve,reject)=>{
	//resolve完成
	//reject 失败
	fs.readFile('./files/aa.txt','utf-8',(err,data)=>{
		if(err){
			reject(err);
		}else{
			resolve(data.length);
		}
	});
});
p.then((result)=>{
	console.log(result);
}).catch((err)=>{
	console.log(err);
})